/**
 * Created by cb-dlhis on 17-1-17.
 */
import { createStore, applyMiddleware, compose } from 'redux';
import mainReducer from '../reducers/mainReducer';
import thunk from 'redux-thunk';

require('date-utils');

let logger = ({ getState }) => {
  return (next) => (action)=> {
    console.log('will dispath', action);
    console.log('state after dispath', getState());
    return next(action);
  }
};


const store = createStore(
  mainReducer,
  {},
  compose(
    applyMiddleware(thunk),
    applyMiddleware(logger)
  )
);

export default store;
